package com.kasax.hilog;

import android.content.Context;

import com.kasax.hilog.formatter.ILogFormatter;
import com.kasax.hilog.formatter.StackTraceFromatter;
import com.kasax.hilog.formatter.ThreadFromatter;

public abstract class LogConfig {
    /**
     * 日志级别
     *
     * @return
     */
    public abstract LogLevel getLogLevel();

    /**
     * 日志tag
     *
     * @return
     */
    public abstract String getLogTag();

    /**
     * 是否包含线程信息
     */
    public abstract boolean includeThreadInfo();

    /**
     * 是否包含异常堆栈
     */
    public abstract boolean includeStackTrace();

    /**
     * 是否启用日志打印
     *
     * @return
     */
    public abstract boolean enable();

    /**
     * 日志文件缓存路径
     *
     * @return
     */
    public abstract String logFileCacheDirPath();

    /**
     * 注入上下文
     *
     * @return
     */
    public abstract Context injectAppContext();

    /**
     * 线程打印
     */
    public ILogFormatter<Thread> THREAD_LOG_FORMATTER = new ThreadFromatter();

    /**
     * 堆栈信息打印
     */
    public ILogFormatter<StackTraceElement[]> STRACK_TRACE_FORMATTER = new StackTraceFromatter();

    /**
     * 注入Json格式化工具
     *
     * @return
     */
    public JsonFormatter injectJsonFrmatter() {
        return null;
    }

    public static abstract class JsonFormatter {
        public abstract String format(Object obj);
    }
}
